Eclipse Platform
Pre-release 3.0

org.eclipse.jface.text.source
Interface IAnnotationAccessExtension

All Known Implementing Classes:
DefaultMarkerAnnotationAccess

public interface IAnnotationAccessExtension

Extension interface for IAnnotationAccess. Allows to get a label for the annotation's type. .

Since:
3.0

Field Summary
static int DEFAULT_LAYER
          The default annotation layer.
 
Method Summary
 int getLayer(Annotation annotation)
          Returns the layer for given annotation.
 Object[] getSupertypes(Object annotationType)
          Returns the list of super types for the given annotation type.
 String getTypeLabel(Annotation annotation)
          Returns the label for the given annotation's type.
 boolean isSubtype(Object annotationType, Object potentialSupertype)
          Returns true if the given annotation is of the given type or false otherwise.
 void paint(Annotation annotation, GC gc, Canvas canvas, Rectangle bounds)
          Draws a graphical representation of the given annotation within the given bounds.
 

Field Detail

DEFAULT_LAYER

public static final int DEFAULT_LAYER
The default annotation layer.

See Also:
Constant Field Values
Method Detail

getTypeLabel

public String getTypeLabel(Annotation annotation)
Returns the label for the given annotation's type.

Parameters:
annotation - the annotation
Returns:
the label the given annotation's type or null if no such label exists

getLayer

public int getLayer(Annotation annotation)
Returns the layer for given annotation. Annotations are considered being located at layers and are considered being painted starting with layer 0 upwards. Thus an annotation at layer 5 will be drawn on top of all co-located annotations at the layers 4 - 0.

Parameters:
annotation - the annotation
Returns:
the layer of the given annotation

paint

public void paint(Annotation annotation,
                  GC gc,
                  Canvas canvas,
                  Rectangle bounds)
Draws a graphical representation of the given annotation within the given bounds.

Parameters:
annotation - the given annotation
canvas - the canvas to draw on
bounds - the bounds inside the canvas to draw on

isSubtype

public boolean isSubtype(Object annotationType,
                         Object potentialSupertype)
Returns true if the given annotation is of the given type or false otherwise.

Parameters:
annotationType - the annotation type
potentialSupertype - the potential super annotation type
Returns:
true if annotation type is a subtype of the potential annotation super type

getSupertypes

public Object[] getSupertypes(Object annotationType)
Returns the list of super types for the given annotation type. This does not include the type itself.

Returns:
the super types for the given annotation type

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.